<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function Person(name,age){
				this.name = name;
				this.age = age;
			}
			Person.prototype.toString = function(){
				return "名字："+this.name+""+"年龄："+this.age
			}
			var per = new Person("小明",19);
			var per2 = new Person("小红",16);
			var per3 = new Person("小绿",14);
			var per4 = new Person("小蓝",21);
			var per5 = new Person("小小",9);
			var perarr = [per,per2,per3,per4,per5];
			var perarr1 = [];
			function hanshu(arr){
				for(var i = 0;i<arr.length;i++){
					if(arr[i].age<19){
						perarr1.push(arr[i]);
					}
				}
			}
			hanshu(perarr);
			console.log(perarr1);
		</script>
	</head>
	<body>
	</body>
</html>
